package dbhandler;

import evthandler.EventMessage;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author Casper, Dennis, Jackie, Jakob
 * @version 1.00
 */
public class Suite {

    private int suiteNo;
    private int rooms;
    private int baths;
    private Style style;

    /**
     *
     * @param suiteNo
     */
    public Suite(int suiteNo) {
        this.suiteNo = suiteNo;
        int styleNo = 0;
        try {
            ResultSet rs = DbCon.getInstance().executeQuery("SELECT * FROM suite WHERE suiteNo=" + suiteNo);
            while (rs.next()) {
                rooms = rs.getInt("rooms");
                baths = rs.getInt("baths");
                styleNo = rs.getInt("styleNo");
            }
        } catch (SQLException ex) {
            new EventMessage("SQL error in Suite", "There was an error performing the sql inquery\n").showException(ex);
        }
        style = new Style(styleNo);
    }
}
